package top.longmarch.flow;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author yuyue
 */
@Slf4j
@EnableTransactionManagement
@SpringBootApplication
public class StartApp {

    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(StartApp.class, args);
        Environment env = application.getEnvironment();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("\n----------------------------------------------------------\n\t" +
                "Local: \t\thttp://localhost:" + port + path + "\n\t" +
                "API Local: \thttp://localhost:" + port + path + "/doc.html\n\t" +
                "----------------------------------------------------------");
    }

}
